{% load socialaccount %}
{% load i18n %}

{% get_providers as socialaccount_providers %}

{% for provider in socialaccount_providers %}
  {% if provider.id == "openid" %}
    {% for brand in provider.get_brands %}
      <li>
        <form action="{% provider_login_url provider.id openid=brand.openid_url process=process next=next %}" method="post">
          {% csrf_token %}
          <button
              class="socialaccount-provider {{ provider.id }} {{ brand.id }} button"
              type="submit"
              title="{{ brand.name }}">
            {% trans verbiage|default:'Connect to' %} {{ brand.name }}
          </button>
        </form>
      </li>
    {% endfor %}
  {% endif %}
  {% if provider.id != 'bitbucket' %}
  {% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}
    <li>
      <form action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params next=next %}" method="post">
        {% csrf_token %}
        <button
            class="socialaccount-provider {{ provider.id }} button"
            type="submit"
            title="{{ provider.name }}">
          {% trans verbiage|default:'Connect to' %} {{ provider.name }}
        </button>
      </form>
    </li>
  {% endif %}
  {% endif %}
{% endfor %}
